import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType'
import Layout from '@/layout'

export default [
  {
    path: '/cmt',
    component: Layout,
    meta: { title: '刷单', icon: 'el-icon-s-help' },
    children: [
      {
        path: 'blocked-wang-no',
        component: () => import('@/feature/cmt/app/blocked-wang-no/index'),
        meta: { title: '停用旺旺号', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('cmt:blocked-wang-no')
          .addButtons([
            {
              handler: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              type: TableButtonType.TOOLBAR,
              label: '添加停用旺旺号',
              icon: 'el-icon-plus'
            },
            {
              handler: 'import',
              type: TableButtonType.TOOLBAR,
              label: '批量导入',
              buttonType: 'danger',
              icon: 'el-icon-upload'
            },
            {
              handler: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'click-farm',
        component: () => import('@/feature/cmt/app/click-farm/index'),
        meta: { title: '刷单记录', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('cmt:click-farm')

          .addButtons([
            {
              handler: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },

            {
              handler: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建刷单',
              icon: 'el-icon-plus'
            },
            {
              handler: 'import',
              type: TableButtonType.TOOLBAR,
              label: '批量导入',
              buttonType: 'success',
              icon: 'el-icon-upload'
            },
            {
              handler: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            }, {
              handler: 'batch-remove',
              type: TableButtonType.TOOLBAR,
              label: '批量删除',
              buttonType: 'danger',
              icon: 'el-icon-edit'
            }, {
              handler: 'clearAll',
              buttonType: 'danger',
              type: TableButtonType.TOOLBAR,
              label: '批量清理',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }

          ])
          .build()
      },
      {
        path: 'click-farm-search',
        component: () => import('@/feature/cmt/app/click-farm/search'),
        meta: { title: '可刷单查询', icon: 'table' },
        buttons: RouteButtonsBuilder.builder('cmt:click-farm').build()
      }
    ]
  }]
